package com.itheima.sort;
import java.*;
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class Demo2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        Random ran=new Random();
        int[] data=new int[sc.nextInt()];
        for (int i = 0; i <data.length ; i++) {
            data[i]=ran.nextInt(1000);
        }
        int guest=sc.nextInt();
        System.out.println(Arrays.binarySearch(data,guest));

    }
}
